<template>
  <router-view />
</template>

<script setup>
import { onMounted } from 'vue'
import { getToken, updateUserInfo } from '@/utils/auth'

onMounted(async () => {
  // 如果有token，则获取最新的用户信息
  if (getToken()) {
    await updateUserInfo()
  }
})
</script>

<style>
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
}

#app {
  height: 100vh;
  width: 100vw;
}
</style>